<template>
  <div style="display: flex; line-height: 60px">
    <el-icon class="iconfont">
      <Operation :style="Header.Operation.style" @click="doCollapse"/>
    </el-icon>
    <div style="flex: 1">
      <h3 class="title3">欢迎来到仓库管理系统</h3>
    </div>

    <div style="display: flex">
      <span>王小虎</span>
      <el-dropdown>
        <el-icon style="margin-right: 8px;margin-left: 7px;" class="iconfont">
          <setting />
        </el-icon>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item @click.native="toUser">个人中心</el-dropdown-item>
            <el-dropdown-item @click.native="exit">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<style scoped>
.iconfont{
  margin-top:23px;
}

.title3{
  font-size: 25px;
  text-align: center;
}
</style>
<script>
import {Operation, Setting} from "@element-plus/icons-vue";

export default {
  components: {Operation, Setting},
  data(){
    return{
    }
  },
  methods:{
    toUser(){
      console.log("个人资料");
    },
    exit(){
      console.log("退出登录");
    },
    doCollapse(){
      console.log("第一次调用");
      this.$emit('doCollapse',[123,456]);
    }
  },
  props:{
    Header:Object
  }
}
</script>